require("babel-core/register");
require("babel-polyfill");

import {ProtocolReactor} from './ProtocolReactor/index'
import {FF55Protocol} from './ProtocolMiddleware/FF55Protocol'

let pr = new ProtocolReactor()
let p = new FF55Protocol()
pr.addProtocol(p)
setTimeout(() => {
    let data = pr.package('ff55', [['byte', 33], ['short', 34455], ['string', 'asdf'] ])
    pr.feedHex(data)
}, 1000);
let main = async() => {
    let [b, 
        s,
        str] = await pr.asyncMatch('ff55', ['byte', 'short', 'string'])
    console.log(str)
};

main()
